package com.e.MyInterface;

public class MyInterface {
    public static void main(String[] args) {
        A a=new B();
        a.a1();
        C c=new D();
        c.c1();
    }
}
interface A{
    void a1();
}
class B implements A{

    @Override
    public void a1() {
        System.out.println("进行打印");
    }
}
 class C{
    public void c1(){
        System.out.println("调用父类的方法");
    }
}
class D extends C{

    @Override
    public void c1() {
        System.out.println("调用自己的方法");
    }
}

